//
//  Fout1ViewController.m
//  UI_豆瓣项目
//
//  Created by dllo on 16/1/11.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "Fout1ViewController.h"
#import "Model.h"
#import "DataBaseHandle.h"
#import "RootModel.h"
#import "Root1ViewController.h"
@interface Fout1ViewController ()<UITableViewDataSource, UITableViewDelegate>

@end

@implementation Fout1ViewController
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        
    }return self;
}
- (void)dealloc {
    [super dealloc];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    UITableView *view = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 375, 667) style:UITableViewStylePlain];
    view.delegate = self;
    view.dataSource = self;
    [self.view addSubview:view];
    [view release];
    [view registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
    

    UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"登录" style:(UIBarButtonItemStylePlain) target:self action:@selector(itemAction:)];
    self.navigationItem.rightBarButtonItem = item;
}

- (void)itemAction:(UIBarButtonItem *)barItem {
    
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return _arr1.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    cell.textLabel.text = _arr1[indexPath.row];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
//    Root1ViewController *vc = [[Root1ViewController alloc] init];
//    [[DataBaseHandle sharedDataBaseHandle] openDB];
//    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
//    if ([self.str isEqualToString:@"我的活动"]) {
//        NSString *str = cell.textLabel.text;
//        for (RootModel *model in _arr1) {
//            if ([model.title isEqualToString:str]) {
//                
//            }
//        }
//    }
//    NSArray *arr = [[DataBaseHandle sharedDataBaseHandle] selectTable];
//   NSDictionary *dic = arr[indexPath.row];
    
    
    
    
    
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
